package args;

public class Demo1 {
    public static void main(String[] args) {
        //可变参数
        System.out.println(getSum(1, 1, 1, 2, 1, 1, 3, 1));


    }

    public static int getSum(int... args) {
        int sum = 0;
        for (int i = 0; i < args.length; i++) {
            sum += args[i];
        }
        return sum;
    }
}
